package com.inray.nbs.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.inray.nbs.dao.BaseDao;
import com.inray.nbs.service.BaseService;

@Service
public class BaseServiceImpl<T> implements BaseService<T>{
	@Resource(name="baseDaoImpl")
	protected BaseDao<T> baseDao;
	
	@Override
	public int insert(T obj) {
		return baseDao.insert(obj);
	}

	@Override
	public int insertBySqlId(String sqlId, Object obj) {
		return baseDao.insertBySqlId(sqlId, obj);
	}

	@Override
	public int delete(Class<T> clazz, int id) {
		return baseDao.delete(clazz, id);
	}

	@Override
	public int deleteBySqlId(String sqlId, Object obj) {
		return baseDao.deleteBySqlId(sqlId, obj);
	}

	@Override
	public int update(T obj) {
		return baseDao.update(obj);
	}

	@Override
	public int updateBySqlId(String sqlId, Object obj) {
		return baseDao.updateBySqlId(sqlId, obj);
	}

	@Override
	public T selectOneById(Class<T> clazz, int id) {
		return baseDao.selectOneById(clazz, id);
	}

	@Override
	public T selectOneBySqlId(String sqlId, Object obj) {
		return baseDao.selectOneBySqlId(sqlId, obj);
	}

	@Override
	public List<T> selectList(Class<T> clazz) {
		return baseDao.selectList(clazz);
	}

	@Override
	public List<T> selectListBySqlId(String sqlId, Object obj) {
		return baseDao.selectListBySqlId(sqlId, obj);
	}

	@Override
	public Map<String, Object> selectMapBySqlId(String sqlId, Object obj,String mapKey){
		return baseDao.selectMapBySqlId(sqlId,obj,mapKey);
	}

	@Override
	public Object selectOne4ObjBySqlId(String sqlId, Object obj) {
		return baseDao.selectOne4ObjBySqlId(sqlId, obj);
	}

	@Override
	public List<Object> selectList4ObjBySqlId(String sqlId, Object obj) {
		return baseDao.selectList4ObjBySqlId(sqlId, obj);
	}
}
